<template>
    <div>
        <TypeNav></TypeNav>
        <ListContainer></ListContainer>
        <TodayRecommend></TodayRecommend>
        <Rank></Rank>
        <Like></Like>
        <Floor v-for="floor in floors" :key="floor.id" :floor="floor"></Floor>
        <Brand></Brand>
    </div>
</template>

<script>
    import TypeNav from "components/TypeNav"
    import ListContainer from "./ListContainer"
    import Brand from "./Brand"
    import Floor from "./Floor"
    import Like from "./Like"
    import Rank from "./Rank"
    import TodayRecommend from "./TodayRecommend"
    import {mapState} from "vuex";
    export default {
        name: "Home",
        computed:{
            ...mapState({
                floors: state => state.home.floors
            })
        },
        components:{
            TypeNav,
            ListContainer,
            Brand,
            Floor,
            Like,
            Rank,
            TodayRecommend
        },
        beforeRouteEnter(to,from,next){
            next((vm)=>{
                console.log("路由组件 beforeRouteEnter.next",vm.$store.state.user.userInfo.name);
            })
        }
    }
</script>

<style scoped>

</style>